package com.jeehentor.generate.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 模型字段配置表
 * </p>
 *
 * @author wzd
 * @since 2024-05-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_gen_model_field")
@Schema(description="模型字段配置表")
public class SysGenModelField implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @Schema(description = "模型id")
    private String modelId;

    @Schema(description = "字段名")
    private String fieldName;

    @Schema(description = "原字段名")
    private String oldFieldName;

    @Schema(description = "字段类型")
    private String fieldType;

    @Schema(description = "字段长度")
    private Integer length;

    @Schema(description = "字段小数点")
    private Integer fieldPoint;

    @Schema(description = "默认值")
    private String defaultValue;

    @Schema(description = "是否为空 0否 1是")
    private String nullable;

    @Schema(description = "是否为必填 1是 0否")
    private String isRequired;

    @Schema(description = "字段备注")
    private String remarks;

    @Schema(description = "是否唯一 0否 1是")
    private String isUnique;

    @Schema(description = "是否主键")
    private String primaryKey;

    @Schema(description = "排序")
    private Integer sortOrder;

    @Schema(description = "是否在页面展示 1是 0否")
    private String isShow;

    @Schema(description = "是否表单字段 1是 0否")
    private String isForm;

    @Schema(description = "是否为查询条件 1是 0否")
    private String isQuery;

    @Schema(description = "查询组件")
    private String searchModule;

    @Schema(description = "表单组件")
    private String formModule;

    @Schema(description = "表单组件配置")
    private String formModuleOption;

    @Schema(description = "显示列宽 像素(px)")
    private String columnWidth;

    @Schema(description = "查询列宽 跨距(span)")
    private String searchSpan;

    @Schema(description = "创建人")
    private String createBy;

    @Schema(description = "创建日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "更新人")
    private String updateBy;

    @Schema(description = "更新日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;


}
